package com.yy.wga.order.service.controller;

import com.yy.wga.common.core.dto.Result;
import com.yy.wga.order.feign.api.OrderGoodsFeign;
import com.yy.wga.order.feign.request.OrderGoodsPageRequest;
import com.yy.wga.order.feign.response.OrderGoodsPageResponse;
import com.yy.wga.order.service.service.OrderGoodsService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * 订单管理
 *
 * @author guochao
 * @since 2024-11-01 21:14:37
 */
@RestController
@RequestMapping("api/order/goods")
public class OrderGoodsController implements OrderGoodsFeign {
    /**
     * 服务对象
     */
    @Resource
    private OrderGoodsService orderGoodsService;

    /**
     * 订单列表
     * @param request
     * @return
     */
    @PostMapping("list")
    public Result<List<OrderGoodsPageResponse>> list(@Valid @RequestBody OrderGoodsPageRequest request) {
        List<OrderGoodsPageResponse> responseList = orderGoodsService.list(request);
        return Result.success(responseList);
    }
}
